home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Utilities / vim-5.1 / syntax / vim.vim < prev    next >
Encoding:
Text File  |  1998-04-01  |  23.8 KB  |  423 lines

  1. " Vim syntax file
  2. " Language:    Vim script
  3. " Maintainer:    Dr. Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
  4. " Last change:    April 1, 1998 (no fooling!)
  5.  
  6. " Remove old syntax
  7. syn clear
  8.  
  9. syn keyword vimTodo contained    TODO
  10.  
  11. " regular vim commands
  12. syn keyword vimCommand contained    I    di[splay]    map    sb[uffer]    wh[ile]
  13. syn keyword vimCommand contained    N[ext]    dig[raphs]    mapc[lear]    sba[ll]    wn[ext]
  14. syn keyword vimCommand contained    a[ppend]    display    marks    sbl[ast]    wp[revous]
  15. syn keyword vimCommand contained    ab[breviate]    dj[ump]    mk[exrc]    sbm[odified]    wq
  16. syn keyword vimCommand contained    abc[lear]    dl[ist]    mkv[imrc]    sbn[ext]    wqa[ll]
  17. syn keyword vimCommand contained    al[l]    do[autocmd]    mod[e]    sbp[revious]    wqall
  18. syn keyword vimCommand contained    ar[gs]    doautoa[ll]    n[ext]    sbr[ewind]    wv[iminfo]
  19. syn keyword vimCommand contained    argu[ment]    ds[earch]    new    se[t]    x[it]
  20. syn keyword vimCommand contained    as[cii]    dsp[lit]    nm[ap]    set    xa[ll]
  21. syn keyword vimCommand contained    au[tocmd]    e[dit]    nmap    sh[ell]    xall
  22. syn keyword vimCommand contained    aug[roup]    ec[ho]    nmapc[lear]    sl[eep]    y[ank]
  23. syn keyword vimCommand contained    autocmd    echoh[l]    nn[oremap]    sla[st]    am
  24. syn keyword vimCommand contained    bN[ext]    echon    no[remap]    sn[ext]    amenu
  25. syn keyword vimCommand contained    b[uffer]    else    norea[bbrev]    so[urce]    an
  26. syn keyword vimCommand contained    ba[ll]    elsei[f]    norm[al]    sp[lit]    anoremenu
  27. syn keyword vimCommand contained    bd[elete]    en[dif]    normal    spr[evious]    aun
  28. syn keyword vimCommand contained    bdelete    endw[hile]    nu[mber]    sr[ewind]    aunmenu
  29. syn keyword vimCommand contained    bl[ast]    ex    nun[map]    st[op]    cme
  30. syn keyword vimCommand contained    bm[odified]    exe[cute]    o[pen]    sta[g]    cmenu
  31. syn keyword vimCommand contained    bn[ext]    exi[t]    om[ap]    stj[ump]    cnoreme
  32. syn keyword vimCommand contained    bp[revious]    f[ile]    omap    sts[elect]    cnoremenu
  33. syn keyword vimCommand contained    br[ewind]    files    omapc[lear]    sun[hide]    cunme
  34. syn keyword vimCommand contained    brea[k]    fix[del]    on[ly]    sus[pend]    cunmenu
  35. syn keyword vimCommand contained    buffers    g[lobal]    ono[remap]    sv[iew]    ime
  36. syn keyword vimCommand contained    bun[load]    global    ou[nmap]    syntax    imenu
  37. syn keyword vimCommand contained    bunload    h[elp]    p[rint]    t    inoreme
  38. syn keyword vimCommand contained    cN[ext]    hid[e]    pe[rl]    tN[ext]    inoremenu
  39. syn keyword vimCommand contained    c[hange]    highlight    perld[o]    ta[g]    iunme
  40. syn keyword vimCommand contained    ca[bbrev]    i[nsert]    po[p]    tags    iunmenu
  41. syn keyword vimCommand contained    cabc[lear]    ia[bbrev]    pre[serve]    the    me
  42. syn keyword vimCommand contained    cc    iabc[lear]    prev[ious]    tj[ump]    menu
  43. syn keyword vimCommand contained    cd    if    pw[d]    tl[ast]    nme
  44. syn keyword vimCommand contained    ce[nter]    ij[ump]    py[thon]    tn[ext]    nmenu
  45. syn keyword vimCommand contained    cf[ile]    il[ist]    pyf[ile]    tp[revious]    nnoreme
  46. syn keyword vimCommand contained    chd[ir]    im[ap]    q[uit]    tr[ewind]    nnoremenu
  47. syn keyword vimCommand contained    che[ckpath]    imap    qa[ll]    ts[elect]    noreme
  48. syn keyword vimCommand contained    cl[ist]    imapc[lear]    qall    u[ndo]    noremenu
  49. syn keyword vimCommand contained    clast    ino[remap]    quit    una[bbreviate]    nunme
  50. syn keyword vimCommand contained    clo[se]    inorea[bbrev]    r[ead]    unh[ide]    nunmenu
  51. syn keyword vimCommand contained    cm[ap]    is[earch]    rec[over]    unl[et]    ome
  52. syn keyword vimCommand contained    cmap    isp[lit]    red[o]    unm[ap]    omenu
  53. syn keyword vimCommand contained    cmapc[lear]    iu[nmap]    redi[r]    v[global]    onoreme
  54. syn keyword vimCommand contained    cn[ext]    iuna[bbrev]    reg[isters]    ve[rsion]    onoremenu
  55. syn keyword vimCommand contained    cno[remap]    j[oin]    res[ize]    vi[sual]    ounme
  56. syn keyword vimCommand contained    cnorea[bbrev]    ju[mps]    resize    vie[w]    ounmenu
  57. syn keyword vimCommand contained    co[py]    k    ret[ab]    vm[ap]    unme
  58. syn keyword vimCommand contained    con[tinue]    l[ist]    rew[ind]    vmap    unmenu
  59. syn keyword vimCommand contained    cp[revious]    la[st]    ri[ght]    vmapc[lear]    vme
  60. syn keyword vimCommand contained    cq    le[ft]    rv[iminfo]    vn[oremap]    vmenu
  61. syn keyword vimCommand contained    cq[uit]    let    sN[ext]    vu[nmap]    vnoreme
  62. syn keyword vimCommand contained    crewind    ls    s[ubstitute]    wN[ext]    vnoremenu
  63. syn keyword vimCommand contained    cu[nmap]    m[ove]    sa[rgument]    w[rite]    vunme
  64. syn keyword vimCommand contained    cuna[bbrev]    ma[rk]    sal[l]    wa[ll]    vunmenu
  65. syn keyword vimCommand contained    d[elete]    mak[e]    sbN[ext]
  66.  
  67. " All vimCommands are contained by vimIsCommands.
  68. syn match vimIsCommand    "^\s*[a-zA-Z]\+"        transparent contains=vimCommand
  69. syn match vimIsCommand    "[:|]\s*[a-zA-Z]\+"    transparent contains=vimCommand
  70.  
  71. " vimOptions are caught only when contained in a vimSet
  72. syn keyword vimOption contained    ai    equalprg    isprint    sb    tags
  73. syn keyword vimOption contained    akm    errorbells    joinspaces    sbr    tbi
  74. syn keyword vimOption contained    al    errorfile    js    sc    tbs
  75. syn keyword vimOption contained    aleph    errorformat    keywordprg    scr    term
  76. syn keyword vimOption contained    altkeymap    esckeys    kp    scroll    terse
  77. syn keyword vimOption contained    autoindent    et    langmap    scrolljump    textauto
  78. syn keyword vimOption contained    autowrite    eventignore    laststatus    scrolloff    textmode
  79. syn keyword vimOption contained    aw    ex    lazyredraw    scs    textwidth
  80. syn keyword vimOption contained    background    expandtab    lbr    sect    tf
  81. syn keyword vimOption contained    backspace    exrc    linebreak    sections    tildeop
  82. syn keyword vimOption contained    backup    ff    lines    secure    timeout
  83. syn keyword vimOption contained    backupdir    ffs    lisp    sh    timeoutlen
  84. syn keyword vimOption contained    backupext    fileformat    list    shcf    title
  85. syn keyword vimOption contained    bdir    fileformats    lmap    shell    titlelen
  86. syn keyword vimOption contained    bex    fk    ls    shellcmdflag    titlestring
  87. syn keyword vimOption contained    bg    fkmap    lz    shellpipe    tl
  88. syn keyword vimOption contained    bin    fo    magic    shellquote    tm
  89. syn keyword vimOption contained    binary    formatoptions    makeef    shellredir    to
  90. syn keyword vimOption contained    biosk    formatprg    makeprg    shelltype    top
  91. syn keyword vimOption contained    bioskey    fp    mat    shellxquote    tr
  92. syn keyword vimOption contained    bk    gcr    matchtime    shiftround    ts
  93. syn keyword vimOption contained    breakat    gd    maxmapdepth    shiftwidth    tsl
  94. syn keyword vimOption contained    brk    gdefault    maxmem    shm    ttimeout
  95. syn keyword vimOption contained    bs    gfn    maxmemtot    shortmess    ttimeoutlen
  96. syn keyword vimOption contained    ch    go    mef    shortname    ttm
  97. syn keyword vimOption contained    cin    guicursor    mh    showbreak    ttybuiltin
  98. syn keyword vimOption contained    cindent    guifont    ml    showcmd    ttyfast
  99. syn keyword vimOption contained    cink    guioptions    mls    showmatch    ttyscroll
  100. syn keyword vimOption contained    cinkeys    guipty    mm    showmode    ttytype
  101. syn keyword vimOption contained    cino    helpfile    mmd    shq    tw
  102. syn keyword vimOption contained    cinoptions    helpheight    mmt    si    tx
  103. syn keyword vimOption contained    cinw    hf    mod    sidescroll    uc
  104. syn keyword vimOption contained    cinwords    hh    modeline    sj    ul
  105. syn keyword vimOption contained    cmdheight    hi    modelines    sm    undolevels
  106. syn keyword vimOption contained    co    hid    modified    smartcase    updatecount
  107. syn keyword vimOption contained    columns    hidden    more    smartindent    updatetime
  108. syn keyword vimOption contained    com    highlight    mouse    smarttab    ut
  109. syn keyword vimOption contained    comments    history    mousehide    smd    vb
  110. syn keyword vimOption contained    compatible    hk    mouset    sn    vbs
  111. syn keyword vimOption contained    complete    hkmap    mousetime    so    verbose
  112. syn keyword vimOption contained    cp    hkmapp    mp    softtabstop    vi
  113. syn keyword vimOption contained    cpo    hkp    nf    sol    viminfo
  114. syn keyword vimOption contained    cpoptions    hl    nrformats    sp    visualbell
  115. syn keyword vimOption contained    cpt    hls    nu    splitbelow    wa
  116. syn keyword vimOption contained    def    hlsearch    number    sr    warn
  117. syn keyword vimOption contained    define    ic    pa    srr    wb
  118. syn keyword vimOption contained    dg    icon    para    ss    wc
  119. syn keyword vimOption contained    dict    iconstring    paragraphs    st    wd
  120. syn keyword vimOption contained    dictionary    ignorecase    paste    sta    weirdinvert
  121. syn keyword vimOption contained    digraph    im    patchmode    startofline    wh
  122. syn keyword vimOption contained    dir    inc    path    sts    whichwrap
  123. syn keyword vimOption contained    directory    include    pm    su    wildchar
  124. syn keyword vimOption contained    ea    incsearch    readonly    suffixes    winheight
  125. syn keyword vimOption contained    eb    inf    remap    sw    wiv
  126. syn keyword vimOption contained    ed    infercase    report    swapsync    wm
  127. syn keyword vimOption contained    edcompatible    insertmode    restorescreen    sws    wrap
  128. syn keyword vimOption contained    ef    is    revins    sxq    wrapmargin
  129. syn keyword vimOption contained    efm    isf    ri    ta    wrapscan
  130. syn keyword vimOption contained    ei    isfname    rightleft    tabstop    writeany
  131. syn keyword vimOption contained    ek    isi    rl    tag    writebackup
  132. syn keyword vimOption contained    endofline    isident    ro    tagbsearch    writedelay
  133. syn keyword vimOption contained    eol    isk    rs    taglength    ws
  134. syn keyword vimOption contained    ep    iskeyword    ru    tagrelative    ww
  135. syn keyword vimOption contained    equalalways    isp    ruler
  136.  
  137. " These are the turn-off setting variants
  138. syn keyword vimOption contained    noai    noesckeys    nojoinspaces    noruler    noterse
  139. syn keyword vimOption contained    noakm    noet    nojs    nosb    notextauto
  140. syn keyword vimOption contained    noalkeymap    noex    nolbr    nosc    notextmode
  141. syn keyword vimOption contained    noautoindent    noexpandtab    nolinebreak    noscs    notf
  142. syn keyword vimOption contained    noautowrite    noexrc    nolisp    nosecure    notildeop
  143. syn keyword vimOption contained    noaw    nofk    nolist    noshiftround    notimeout
  144. syn keyword vimOption contained    nobackup    nofkmap    nomagic    noshortname    notitle
  145. syn keyword vimOption contained    nobin    nogd    nomh    noshowcmd    noto
  146. syn keyword vimOption contained    nobinary    nogdefault    noml    noshowmatch    notop
  147. syn keyword vimOption contained    nobiosk    noguipty    nomod    noshowmode    notr
  148. syn keyword vimOption contained    nobioskey    nohid    nomodeline    nosi    nottimeout
  149. syn keyword vimOption contained    nobk    nohidden    nomodified    nosm    nottybuiltin
  150. syn keyword vimOption contained    nocin    nohk    nomore    nosmartcase    nottyfast
  151. syn keyword vimOption contained    nocindent    nohkmap    nomousehide    nosmartindent    notx
  152. syn keyword vimOption contained    nocompatible    nohkmapp    nonu    nosmarttab    novb
  153. syn keyword vimOption contained    nocp    nohkp    nonumber    nosmd    novisualbell
  154. syn keyword vimOption contained    nodg    nohls    nopaste    nosn    nowa
  155. syn keyword vimOption contained    nodigraph    nohlsearch    noreadonly    nosol    nowarn
  156. syn keyword vimOption contained    noea    noic    noremap    nosplitbelow    nowb
  157. syn keyword vimOption contained    noeb    noicon    norestorescreen    nosr    noweirdinvert
  158. syn keyword vimOption contained    noed    noignorecase    norevins    nosta    nowiv
  159. syn keyword vimOption contained    noedcompatible    noim    nori    nostartofline    nowrap
  160. syn keyword vimOption contained    noek    noincsearch    norightleft    nota    nowrapscan
  161. syn keyword vimOption contained    noendofline    noinf    norl    notagbsearch    nowriteany
  162. syn keyword vimOption contained    noeol    noinfercase    noro    notagrelative    nowritebackup
  163. syn keyword vimOption contained    noequalalways    noinsertmode    nors    notbi    nows
  164. syn keyword vimOption contained    noerrorbells    nois    noru    notbs
  165.  
  166. " termcap codes (which can also be set)
  167. syn keyword vimOption contained    t_AB    t_RI    t_da    t_k9    t_ks    t_so
  168. syn keyword vimOption contained    t_AF    t_Sb    t_db    t_kD    t_ku    t_sr
  169. syn keyword vimOption contained    t_AL    t_Sf    t_dl    t_kI    t_le    t_te
  170. syn keyword vimOption contained    t_CS    t_ZH    t_k1    t_kN    t_mb    t_ti
  171. syn keyword vimOption contained    t_Co    t_ZR    t_k2    t_kP    t_md    t_ue
  172. syn keyword vimOption contained    t_DL    t_al    t_k3    t_kb    t_me    t_us
  173. syn keyword vimOption contained    t_F1    t_bc    t_k4    t_kd    t_mr    t_vb
  174. syn keyword vimOption contained    t_F2    t_cd    t_k5    t_ke    t_ms    t_ve
  175. syn keyword vimOption contained    t_K1    t_ce    t_k6    t_kh    t_nd    t_vi
  176. syn keyword vimOption contained    t_K3    t_cl    t_k7    t_kl    t_op    t_vs
  177. syn keyword vimOption contained    t_K4    t_cm    t_k8    t_kr    t_se    t_xs
  178. syn keyword vimOption contained    t_K5    t_cs
  179. syn match   vimOption contained    "t_#4"
  180. syn match   vimOption contained    "t_%1"
  181. syn match   vimOption contained    "t_%i"
  182. syn match   vimOption contained    "t_&8"
  183. syn match   vimOption contained    "t_@7"
  184. syn match   vimOption contained    "t_k;"
  185.  
  186. " these settings don't actually cause errors in vim, but were supported by vi and don't do anything in vim
  187. syn keyword vimErrSetting contained    ap    gr    op    slow    w1200
  188. syn keyword vimErrSetting contained    autoprint    graphic    open    slowopen    w300
  189. syn keyword vimErrSetting contained    beautify    hardtabs    optimize    sourceany    w9600
  190. syn keyword vimErrSetting contained    bf    ht    prompt    tagstack    wi
  191. syn keyword vimErrSetting contained    fl    mesg    redraw    tgst    window
  192. syn keyword vimErrSetting contained    flash    novice
  193.  
  194. " AutoBuf Events
  195. syn keyword vimAutoEvent contained    BufDelete    BufReadPre    FileAppendPre    FilterReadPost    TermChanged
  196. syn keyword vimAutoEvent contained    BufEnter    BufUnload    FileChangedShell    FilterReadPre    User
  197. syn keyword vimAutoEvent contained    BufLeave    BufWrite    FileReadPost    FilterWritePost    VimLeave
  198. syn keyword vimAutoEvent contained    BufNewFile    BufWritePost    FileReadPre    FilterWritePre    WinEnter
  199. syn keyword vimAutoEvent contained    BufRead    BufWritePre    FileWritePost    StdinReadPost    WinLeave
  200. syn keyword vimAutoEvent contained    BufReadPost    FileAppendPost    FileWritePre    StdinReadPre
  201.  
  202. " Highlight commonly used Groupnames
  203. syn keyword vimGroup    Comment    Identifier    Keyword    Type    Tag
  204. syn keyword vimGroup    Constant    Function    Exception    StorageClass    Delimiter
  205. syn keyword vimGroup    String    Statement    PreProc    Structure    SpecialComment
  206. syn keyword vimGroup    Character    Conditional    Include    Typedef    Debug
  207. syn keyword vimGroup    Number    Repeat    Define    Special    Error
  208. syn keyword vimGroup    Boolean    Label    Macro    SpecialChar    Todo
  209. syn keyword vimGroup    Float    Operator    PreCondit
  210.  
  211. " Default highlighting groups
  212. syn keyword vimHLGroup    Cursor    LineNr    MoreMsg    Question    SpecialKey    Title
  213. syn keyword vimHLGroup    Directory    Menu    NonText    Scrollbar    StatusLine    Visual
  214. syn keyword vimHLGroup    ErrorMsg    ModeMsg    Normal    Search    StatusLineNC    WarningMsg
  215. syn keyword vimHLGroup    IncSearch
  216.  
  217. "--- syntax above generated by mkvimvim ---
  218. " Highlight syntax stuff
  219.  
  220. syn keyword vimPattern contained    start    skip    end
  221.  
  222. syn keyword vimSpecial    ALL    ccomment    matchgroup    skipempty    sync
  223. syn keyword vimSpecial    NONE    lines    minlines    skipnl    transparent
  224.  
  225. " Highlight syntax stuff -- the following vimSpecials aren't keywords because Vim's syntax checking
  226. " disapproves
  227. syn match vimSpecial    contained    "\<ALLBUT\>"
  228. syn match vimSpecial    contained    "\<clear\>"
  229. syn match vimSpecial    contained    "\<contained\>"
  230. syn match vimSpecial    contained    "\<oneline\>"
  231. syn match vimSpecial    contained    "\<contains\>"
  232. syn match vimSpecial    contained    "\<grouphere\>"
  233. syn match vimSpecial    contained    "\<groupthere\>"
  234. syn match vimSpecial    contained    "\<keepend\>"
  235. syn match vimSpecial    contained    "\<maxlines\>"
  236. syn match vimSpecial    contained    "\<nextgroup\>"
  237. syn match vimSpecial    contained    "\<skipempty\>"
  238. syn match vimSpecial    contained    "\<skipnl\>"
  239. syn match vimSpecial    contained    "\<skipwhite\>"
  240. syn match vimSpecial    contained    "\<transparent\>"
  241.  
  242. " Highlight Terminal Stuff
  243. syn keyword vimTermSet  contained    background    cterm    ctermfg    font    gui    guifg
  244. syn keyword vimTermSet  contained    bg    ctermbg    fg    foreground    guibg    term    start
  245. syn match   vimTermSet  contained    "stop"
  246.  
  247. " Special Filenames and Modifiers
  248. syn match vimSpecFile    "<\(cword\|cWORD\|[cas]file\)>"    nextgroup=vimSpecFileMod
  249. syn match vimSpecFile    "#[0-9]\|[#%]"        nextgroup=vimSpecFileMod
  250. syn match vimSpecFileMod    "\(:[phtre]\)\+"        contained
  251.  
  252. " Commands, function, and conditionals
  253. syn keyword vimFunction    buffer_exists exists expand file_readable getline has highlight_exists last_buffer_nr ret strftime strlen substr
  254.  
  255. syn match vimConditional    "^\s*\(continue\|con\)\>"
  256. syn match vimConditional    "^\s*\(endif\|en\)\>"
  257. syn match vimConditional    "^\s*\(endwhile\|endw\)\>"
  258. syn match vimConditional    "^\s*\(while\|wh\)\>"
  259. syn match vimConditional    "^\s*break\=\>"
  260. syn match vimConditional    "^\s*else\>"
  261. syn match vimConditional    "^\s*elseif\=\>"
  262. syn match vimConditional    "^\s*if\>"
  263.  
  264. " Operators
  265. syn match vimOper    "||\|&&\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|+\|-\|=\|\." skipwhite nextgroup=vimString
  266.  
  267. " Numbers
  268. syn match vimNumber    "\<[0-9]\+.[0-9]\+"
  269. syn match vimNumber    "\<[0-9]\+L\="
  270. syn match vimNumber    "-[0-9]\+.[0-9]\+"
  271. syn match vimNumber    "-[0-9]\+L\="
  272. syn match vimNumber    "[[;:][0-9]\+"lc=1
  273. syn match vimNumber    "0[xX][0-9a-fA-F]\+"
  274. syn match vimNumber    "#[0-9a-fA-F]\+"
  275.  
  276. " Lower Priority Comments: after some vim commands...
  277. syn match vimComment    +\s"[^\-:.%#=*].*$+lc=1    contains=vimTodo
  278. syn match vimComment    +\<endif\s\+".*$+lc=5    contains=vimTodo
  279. syn match vimComment    +\<else\s\+".*$+lc=4    contains=vimTodo
  280. syn match vimComment    +^\s*".*$+        contains=vimTodo
  281.  
  282. " Try to catch strings, if nothing else matches (therefore it must precede the others!)
  283. "  vmEscapeBrace handles ["]  []"] (ie. stays as string)
  284. syn region    vimEscapeBrace    start="[^\\]\(\\\\\)*\[\^\=\]\=" skip="\\\\\|\\\]" end="\]"me=e-1    oneline contained transparent
  285. syn match    vimPatSep    "\\[|()]"hs=e-1    contained
  286. syn match    vimNotPatSep    "\\\\"    contained
  287. syn region    vimString    start=+[^:a-zA-Z>!\\]"+lc=1 skip=+\\\\\|\\"+ end=+"+ oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  288. syn region    vimString    start=+[^:a-zA-Z>!\\]'+lc=1 skip=+\\\\\|\\'+ end=+'+ oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  289. syn region    vimString    start=+=!+lc=1    skip=+\\\\\|\\!+ end=+!+    oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  290. syn region    vimString    start="=+"lc=1    skip="\\\\\|\\+" end="+"    oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  291. syn region    vimString    start="[^\\]+\s*[^a-zA-Z0-9.]"lc=1 skip="\\\\\|\\+" end="+"    oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  292. syn region    vimString    start="\s/\s*[^a-zA-Z]"lc=1 skip="\\\\\|\\+" end="/"    oneline contains=vimEscapeBrace,vimPatSep,vimNotPatSep
  293.  
  294. " Substitutions
  295. syn region    vimSubst    start=":\=s/.\{-}" skip="\(\\\\\)*\\/" end="/"    oneline contains=vimPatSep,vimSubstTwoBS,vimSubstRange,vimNotation nextgroup=vimSubstEnd
  296. syn region    vimSubstEnd    start="."lc=1    skip="\(\\\\\)*\\/"   end="/"    oneline contained contains=vimSubstPat,vimSubstTwoBS,vimNotation
  297. syn region    vimSubstRange    start="\["    skip="\(\\\\\)*\\]"   end="]"    oneline contained
  298. syn match    vimSubstPat    "\\[0-9]"            contained
  299. syn match    vimSubstTwoBS    "\\\\"            contained
  300.  
  301. " Marks, Registers, Addresses, Filters
  302. syn match    vimMark    "[!,:]'[a-zA-Z0-9]"lc=1
  303. syn match    vimMark    "'[a-zA-Z0-9][,!]"me=e-1
  304. syn match    vimMark    "[^a-zA-Z]norm\s'[a-zA-Z0-9]"lc=6
  305. syn match    vimMark    "[^a-zA-Z]normal\s'[a-zA-Z0-9]"lc=8
  306. syn match    vimPlainMark    "'[a-zA-Z0-9]"        contained
  307.  
  308. syn match    vimRegister    '[^(,;]"[a-zA-Z0-9\-:.%#*=][^a-zA-Z_"]'lc=1
  309. syn match    vimRegister    '[^a-zA-Z]norm\s"[a-zA-Z0-9]'lc=6
  310. syn match    vimRegister    '[^a-zA-Z]normal\s"[a-zA-Z0-9]'lc=8
  311. syn match    vimPlainRegister    '"[a-zA-Z0-9\-:.%#*=]'    contained
  312.  
  313. syn match    vimAddress    ",\."lc=1
  314. syn match       vimAddress    "[:|][%.]"lc=1
  315. syn match       vimAddress    "<Bar>%"lc=5
  316.  
  317. syn match    vimFilter    ":\s*!"ms=e
  318. syn match    vimFilter    "[^a-zA-Z]!"lc=1
  319.  
  320. " Complex repeats
  321. syn match vimCmplxRepeat    '[^a-zA-Z_]q[0-9a-zA-Z"]'lc=1
  322. syn match vimCmplxRepeat    '@[0-9a-z".=@:]'
  323.  
  324. " High Priority Comments: beginning of line with optional spaces then "
  325. syn match vimComment    +^\s*".*$+    contains=vimTodo
  326.  
  327. " Set command and associated set-options (vimOptions) with comment
  328. syn region vimSet matchgroup=vimCommand start="\s*set\>" end="|\|$"    keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString
  329. syn region vimSetEqual  contained    start="="    skip="\(\\\\\)*\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar
  330. syn region vimSetString contained    start=+="+hs=s+1    skip=+\(\\\\\)\\"+   end=+"+    contains=vimCtrlChar
  331.  
  332. " Highlight modifiers
  333. syn keyword VimHLMod contained NONE bold inverse italic reverse standout underline
  334.  
  335. " Autocmd
  336. syn match  vimIsCommand2 "[ \t<Bar>][a-zA-Z_]\+"lc=1 transparent contained contains=vimCommand
  337. syn region vimAutoCmd matchgroup=vimAutoSet start=+^\s*\(autocmd\|au\)\>+    end="$" keepend contains=vimAutoEvent,vimSet,vimIsCommand,vimIsCommand2,vimString,vimComment,vimSpecFile,vimNotation,vimFilter,vimAuSynLine,vimAuRegion
  338. syn region vimAutoCmd matchgroup=vimAutoSet start=+^\s*\(doautoa\|doautoall\)\>+    end="$" keepend contains=vimAutoEvent,vimSet,vimIsCommand,vimIsCommand2,vimString,vimComment,vimSpecFile,vimNotation,vimFilter,vimAuSynLine,vimAuRegion
  339.  
  340. " Syntax regions (all oneliners)
  341. syn keyword vimKeyword link match        contained
  342. syn keyword vimCase    ignore match    contained
  343. syn keyword vimSynGroup add remove    contained
  344. syn match   vimSynGroup "contains"    contained
  345. syn region vimSynLine matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+keyword" end="$"    keepend contains=vimKeyword,vimSpecial,vimComment
  346. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+region"  end="$"    keepend contains=vimKeyword,vimSpecial,vimString,vimPattern,vimComment
  347. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+match"   end="$"    keepend contains=vimKeyword,vimSpecial,vimString,vimComment
  348. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+clear"rs=e-5 end="$"    keepend contains=vimSpecial,vimComment
  349. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+case"    end="$"    keepend contains=vimCase,vimComment
  350. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+sync"    end="$"    keepend contains=vimKeyword,vimSpecial,vimString,vimComment
  351. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(syntax\|syn\)\s\+group"   end="$"    keepend contains=vimSynGroup,vimComment
  352. syn region vimRegion  matchgroup=vimKeyword start="^\s*\(highlight\|hi\)\s" end="$"        keepend contains=vimKeyword,vimSpecial,vimGroup,vimTermSet,vimComment,vimCtrlChar,VimRegion,vimNotation,vimNumber,vimHLMod,vimOption,vimHLGroup
  353.  
  354. syn region vimAuSynLine matchgroup=vimKeyword start="\s\(syntax\|syn\)\s\+keyword"lc=1 end="$"    keepend contains=vimKeyword,vimSpecial,vimComment contained
  355. syn region vimAuRegion  matchgroup=vimKeyword start="\s\(syntax\|syn\)\s\+region"lc=1 end="$"    keepend contains=vimKeyword,vimSpecial,vimString,vimPattern,vimComment contained
  356. syn region vimAuRegion  matchgroup=vimKeyword start="\s\(syntax\|syn\)\s\+match"lc=1 end="$"    keepend contains=vimKeyword,vimSpecial,vimString,vimComment contained
  357. syn region vimAuRegion  matchgroup=vimKeyword start="\s\(syntax\|syn\)\s\+clear"rs=e-5 end="$"    keepend contains=vimSpecial,vimComment contained
  358. syn region vimAuRegion  matchgroup=vimKeyword start="\s\(syntax\|syn\)\s\+case"lc=1 end="$"    keepend contains=vimCase,vimComment contained
  359. syn region vimAuRegion  matchgroup=vimKeyword start="\s\(syntax\|syn\)\s\+sync"lc=1 end="$"    keepend contains=vimKeyword,vimSpecial,vimString,vimComment contained
  360. syn region vimAuRegion  matchgroup=vimKeyword start="\s\(highlight\|hi\)\s"lc=1 end="$"    keepend contains=vimKeyword,vimSpecial,vimGroup,vimTermSet,vimComment,vimCtrlChar,VimRegion,vimNotation,vimNumber,vimHLMod,vimOption,vimHLGroup contained
  361.  
  362. " Angle-Bracket Notation
  363. syn match vimNotation    "<[a-zA-Z][a-zA-Z0-9]\+>"        contains=vimBracket
  364. syn match vimNotation    "<C-[A-Z]>"            contains=vimBracket
  365. syn match vimNotation    "<[AM]-.>"            contains=vimBracket
  366. syn match vimNotation    "<[SCAM]-\(Right\|Left\|Down\|Up\)>"    contains=vimBracket
  367. syn match vimNotation    "<S-F[0-9]>"            contains=vimBracket
  368. syn match vimNotation    '<C-R>[0-9a-z"%#:.\-=]'he=e-1        contains=vimBracket
  369. syn match vimNotation    "<CR>"            contains=vimBracket nextgroup=vimPlainMark,vimPlainRegister,vimAddress
  370. syn match vimNotation    "<Esc>"            contains=vimBracket nextgroup=vimPlainMark,vimPlainRegister,vimAddress
  371. syn match vimBracket contained    "[<>]"
  372.  
  373. " Control Characters
  374. syn match vimCtrlChar    "[- -]"
  375.  
  376. if !exists("did_vim_syntax_inits")
  377.   let did_vim_syntax_inits = 1
  378.   " The default methods for highlighting.  Can be overridden later
  379.   hi link vimAddress    vimMark
  380.   hi link vimAutoSet    vimCommand
  381.   hi link vimConditional    vimStatement
  382.   hi link vimFilter    vimOper
  383.   hi link vimHLGroup    vimGroup
  384.   hi link vimNotPatSep    vimString
  385.   hi link vimPlainMark    vimMark
  386.   hi link vimPlainRegister    vimRegister
  387.   hi link vimSetString    vimString
  388.   hi link vimSpecFileMod    vimSpecFile
  389.   hi link vimSynGroup    vimSpecial
  390.   hi link vimTerminal    vimGroup
  391.  
  392.   hi link vimAutoEvent    Type
  393.   hi link vimBracket    Delimiter
  394.   hi link vimCmplxRepeat    SpecialChar
  395.   hi link vimCommand    Statement
  396.   hi link vimComment    Comment
  397.   hi link vimCtrlChar    SpecialChar
  398.   hi link vimErrSetting    Error
  399.   hi link vimFunction    Function
  400.   hi link vimGroup    Type
  401.   hi link vimHLMod    PreProc
  402.   hi link vimKeyword    Statement
  403.   hi link vimMark    Number
  404.   hi link vimNotation    Special
  405.   hi link vimNumber    Number
  406.   hi link vimOper    Operator
  407.   hi link vimOption    PreProc
  408.   hi link vimPatSep    SpecialChar
  409.   hi link vimPattern    Type
  410.   hi link vimRegister    SpecialChar
  411.   hi link vimSpecFile    Identifier
  412.   hi link vimSpecial    Type
  413.   hi link vimStatement    Statement
  414.   hi link vimString    String
  415.   hi link vimSubstPat    SpecialChar
  416.   hi link vimTermSet    StorageClass
  417.   hi link vimTodo    Todo
  418. endif
  419.  
  420. let b:current_syntax = "vim"
  421.  
  422. " vim: ts=17
  423.